home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1838 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  813 b 

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: weatby@aol.com (Weatby)
  3. Newsgroups: comp.lang.c++
  4. Subject: Memory deallocation in C and C++
  5. Date: 13 Jan 1996 03:40:57 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4d7r6p$dvg@newsbf02.news.aol.com>
  9. Reply-To: weatby@aol.com (Weatby)
  10. NNTP-Posting-Host: newsbf02.mail.aol.com
  11.  
  12. delete() and free() can cause problems on at least some compilers if
  13. called with an invalid pointer.
  14.  
  15. It would seem to me that a better idea would be that if the pointer passed
  16. hasn't been allocated by the memory management system, it could just be
  17. ignored, instead of causing a crash as does on my compiler.
  18.  
  19. Or, a return value could be added to indicate a bad status.
  20.  
  21. Any comments/ideas on why these are not done?
  22.  
  23. Thanks.
  24.  
  25. Bob
  26.